#ifndef _DRVUSARTH_
#define _DRVUSARTH_

#include "sio.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
#ifdef BSP_USE_USART1    
    USART1_INDEX,
#endif
#ifdef BSP_USE_USART2    
    USART2_INDEX,
#endif
#ifdef BSP_USE_USART3        
    USART3_INDEX,
#endif
    USART_MAX
}Stm32UsartIndex;

typedef struct _stm32UsartConfig{
    Stm32UsartIndex index;
    int     txpin;
    int     rxpin;
    SIO_PARAM param;
    char    *rxBuf;
    char    *txBuf;
}Stm32UsartConfig;

typedef struct _stm32l0Usart {
    SioBase super;
    struct {
        uint32_t owner;
        Stm32UsartConfig *config;
        SioOps  ops;
    }Protected;
}Stm32l0Usart;

void Stm32UsartCreate(Stm32l0Usart* sio, const char *name , Stm32UsartConfig *config, uint32_t rxSize, uint32_t txSize);

#ifdef __cplusplus
}
#endif

#endif  /* sioh */